import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Pirañas here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Piranas extends Enemigos
{
    /**
     * Act - do whatever the Pirañas wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private GreenfootImage pirana1=new GreenfootImage("pirana1.png");
     private GreenfootImage pirana2=new GreenfootImage("pirana2.png");
      private GreenfootImage pirana3=new GreenfootImage("pirana3.png");
      private int numero;
    public void act() 
    {
        // Add your action code here.
        this.move(2);
        movimiento();        
        if(resistencia>=2){
            dejaRegalo();
            getWorld().removeObject(this);
        }
    } 
    public Piranas(){
    
    numero =0;
    setImage(pirana2);
    resistencia=0;
     
    }
   
    public void movimiento(){
        numero++;
    if(numero==10){setImage(pirana1);}
    if(numero==20){setImage(pirana2);}
    if(numero==30){setImage(pirana3);numero=0;}
    
    }
   
   
}
